﻿<div ng-controller="platformBillController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default"
                           data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">客户充值开票查询</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <input class="form-control" type="text" ng-model="filter.phoneNumber"
                                           placeholder="管理员或者操作员手机号(严格匹配)">
                                    <input class="form-control" type="text" ng-model="filter.customerName"
                                           placeholder="客户名称(严格匹配)">
                                    <input class="form-control" type="text" ng-model="filter.personPhone"
                                           placeholder="企业名称">
                                    <input class="form-control" type="text" ng-model="filter.accountNumber"
                                           placeholder="银行账号">

                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i
                                            class="fa fa-search"></i> 筛选
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html"
                           class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'企业名称'" sortable="'enterprise_name'" class="text-center">{{
                                item.enterprise_name }}
                            </td>
                            <td data-title="'企业市区地址'" class="text-center">{{ item.enterprise_address }}</td>
                            <td data-title="'企业电话'" class="text-center">{{ item.telephone }}</td>
                            <td data-title="'企业传真'" class="text-center">{{ item.fax_number }}</td>
                            <td data-title="'企业管理员名称'" class="text-center">{{ item.enterprise_admin.name }}</td>
                            <td data-title="'企业管理员电话'" class="text-center">{{ item.enterprise_admin.phone }}</td>
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="show(item)"><i class="fa fa-edit"></i> 详细
                                </button>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="modal fade" id="modal-show">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <ng-form name="checkForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
                                    </button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>客户开票详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                        <div class="col-sm-12">
                                            <div class="form-inline filter-option">
                                                <div class="row">
                                                    <div class="col-md-12">
                                                        <div class="pull-right">
                                                            <input type="radio" name="checked"  value="0"
                                                                   ng-model="filter.isMadeBill" ng-change="reflash2()"> 未开票
                                                            <input type="radio" name="checked" value="1"
                                                                   ng-model="filter.isMadeBill" ng-change="reflash2()"> 已开票
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <script type="text/ng-template" id="checkboxheader.html">
                                                <input type="checkbox" class="group-checkbox" ng-model="checkboxes.checked">
                                            </script>
                                            <table  ng-table="tableParams2" template-pagination="template/pagination.html"
                                                   class="table table-striped table-bordered table-hover table-condensed">
                                                <tr ng-repeat="item in $data">

                                                    <td  header="'checkboxheader.html'">
                                                        <input class="group-checkbox" type="checkbox" ng-model="checkboxes.items[item.id]">
                                                    </td>
                                                    <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                                                    <td data-title="'充值金额'" sortable="'change_price'" class="text-center">{{ item.change_price|currency }}</td>
                                                    <td data-title="'充值类型'" sortable="'change_type'" class="text-center">{{ item.change_type == 1 ? "充值":"消费" }}</td>
                                                    <td data-title="'充值时间'" sortable="'change_time'" class="text-right">{{ item.change_time | date: 'yyyy-MM-dd'}}</td>
                                                    <td data-title="'开具发票状态'"  class="text-center">{{ item.is_made_bill == 0 ? '未开票' : '已开票' }}</td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn btn-sm btn-success" ng-click="invoicing()">
                                        <i class="fa fa-save"></i> 开票
                                    </button>
                                    <button class="btn btn-sm btn-white" data-dismiss="modal"><i
                                            class="fa fa-share-square-o"></i> 关闭
                                    </button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

